<table class="layui-table" style="width:3500px;" id="contentTab">
 	<input type="hidden" id="billId" th:value="${saleOrderItem.id}"/>
 	<input type="hidden" id="billNo" th:value="${saleOrderItem.billNo}"/>
 	<input type="hidden" id="companyId" th:value="${saleOrderItem.companyId}"/>
 	<input type="hidden" id="customerId" th:value="${saleOrderItem.customerId}"/>
  <thead>
    <tr>
    	 <th><input type="checkBox" lay-skin="primary" name="headCheckBox" lay-filter="headCheckBox"/></th>
      	 <th data-field="sourceBillNo">来源单号</th>
		 <th data-field="materialCoding">物料编码</th>
		 <th data-field="materialName">物料名称</th>
		 <th data-field="materialSpec">物料规格</th>
		 <th data-field="materialTypeName">物料类型</th>
		 <th data-field="brandName">品牌</th>
		 <th data-field="measurementUName">计量单位</th>
		 <th data-field="storeageName">预出仓库</th>
		 <th data-field="cMaterialCoding">客户物料编码</th>
		 <th data-field="cMaterialName">客户物料名称</th>
		 <th data-field="cMaterialSpec">客户物料规格</th>
		<!--  <th data-field="settlementType">结算方式</th>
		 <th data-field="settlementDay">结算天数</th>
		 <th data-field="settlementCurrency">结算币种</th>
		 <th data-field="settlementExchangeRate">汇率</th>
		 <th data-field="origTaxRate">税率</th> -->
		 <th data-field="amount">订单数量</th>
		 <th data-field="deliveryTime">交货日期</th>
		 <th data-field="price">单价</th>
		 <th data-field="origDiscountAmount">未税金额</th>
		 <th data-field="origTaxPrice">含税单价</th>
		 <th data-field="origTaxAmount">含税金额</th>
		 <th data-field="origTax">税额</th>
		 <th data-field="deliveredQuantity">订单已交付量</th>
		 <th data-field="deliveredNonQuantity">订单未交量</th>
		 <th data-field="balanceOfAccount">已对账数量</th>
		 <th data-field="balanceNonAccount">未对账数量</th>
    </tr>
     </thead>
    <tbody>
   
    <tr th:each="item : ${details}" class="edittr" >
    	<td style="width:40px;"><input type="checkBox" lay-skin="primary" name="trCheckBox"/></td>
		<td style="width:150px;"><input type="hidden" name="id" th:value="${item.id}"/><span th:text="${item.sourceBillNo}"></span></td>
		<td style="width:150px;padding-left:0px;padding-right:0px;">
			<input type="text" name="materialCoding" class="layui-input" style="width:150px;" th:value="${item.materialCoding}"/>
			<input type="hidden" name="materialId" class="layui-input" style="width:150px;" th:value="${item.materialId}"/>
		</td>
		<td name='name' style="background-color:#f3f2f2;width:200px;" th:text="${item.materialName}"></td>
		<td name='spec' style="background-color:#f3f2f2" th:text="${item.materialSpec}"></td>
		<td name="type" style="background-color:#f3f2f2" th:text="${item.materialTypeName}"></td>
		<td name="brandName" style="background-color:#f3f2f2" th:text="${item.brandName}"></td>
		<td name="measureUnit" style="background-color:#f3f2f2" th:text="${item.measurementUName}"></td>
		<td name="storeageName" style="background-color:#f3f2f2;width:160px;">
			<select lay-filter="storeageName" name="storeageId">
				<option value="">请选择仓库</option>	
				<option th:each="s :${stores}" th:value="${s.code}" th:text="${s.value}" th:selected="${item.storeageName==s.value}"></option>
			</select>
		</td>
		<td name="sup_code" style="background-color:#f3f2f2" th:text="${item.cMaterialCoding}"></td>
		<td name="sup_name" style="background-color:#f3f2f2" th:text="${item.cMaterialName}"></td>
		<td name="sup_spec" style="background-color:#f3f2f2" th:text="${item.cMaterialSpec}"></td>
		<!-- 
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;text-align:center;">
			<span th:text="${item.settlementType}"></span>

		</td>
		<td style="background-color:#f3f2f2" name="settlementDay"><span th:text="${item.settlementDay}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementCurrency"><span th:text="${item.settlementCurrency}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementExchangeRate"><span th:text="${item.exchargeRate}"></span></td>
		<td style="background-color:#f3f2f2" name="origTaxRate"><span th:text="${item.origTaxRate}"></span>%</td> 
		-->
		<td style="padding-left:0px;padding-right:0px;width:120px;"><input style="width:120px;" type="text" name="amount" required  lay-verify="required|amountber" placeholder="订单数量" autocomplete="off" class="layui-input" th:value="${item.amount}"/></td>
		<td style="padding-left:0px;padding-right:0px;width:120px;"><input style="width:120px;" type="text" id="deliveryTime" name="deliveryTime" required  lay-verify="required|amountber" placeholder="交货日期" autocomplete="off" class="layui-input" th:value="${#dates.format(item.deliveryTime, 'yyyy-MM-dd')}"/></td>
		<td style="padding-left:0px;padding-right:0px;width:80px;"><input style="width:80px;" type="text" name="price" required  lay-verify="required|amountber" placeholder="单价" autocomplete="off" class="layui-input" th:value="${item.price}"/></td>
		<td name="origTaxPrice" style="background-color:#f3f2f2"><span th:text="${item.origTaxPrice}"></span></td>
		<td name='origDiscountAmount' style="background-color:#f3f2f2"><span th:text="${item.origDiscountAmount}"></span></td>
		<td name="origTax" style="background-color:#f3f2f2"><span th:text="${item.origTax}"></span></td>
		<td name="origTaxAmount" style="background-color:#f3f2f2"><span th:text="${item.origTaxAmount}"></span></td>
		<td><span th:text="${item.deliveredQuantity}"></span></td>
		<td><span th:text="${item.deliveredNonQuantity}"></span></td>
		<td name="balanceOfAccount" th:text="${item.balanceOfAccount}"></td>
		<td name="balanceNonAccount" th:text="${item.balanceNonAccount}"></td>
	</tr>
	</tbody>
</table>
<table style="display:none;" id="blankTpl">
<tbody>
<tr class="edittr">
		<td style="width:40px;"><input type="checkBox" lay-skin="primary" name="trCheckBox" lay-filter="trCheckBox"/></td>
		<td style="width:50px"><input type="hidden" name="id" value=""/><span th:text="${saleOrderItem.sourceBillNo}"></span></td>
		<td style="width:150px;padding-left:0px;padding-right:0px;">
			<input type="text" name="materialCoding" class="layui-input" style="width:150px;" value=""/>
			<input type="hidden" name="materialId" class="layui-input" style="width:150px;" value=""/>
		</td>
		<td name='name' style="background-color:#f3f2f2;width:200px;"><span></span></td>
		<td name='spec' style="background-color:#f3f2f2"></td>
		<td name="type" style="background-color:#f3f2f2"></td>
		<td name="brandName" style="background-color:#f3f2f2"></td>
		<td name="measureUnit" style="background-color:#f3f2f2"></td>
		<td name="storeageName" style="background-color:#f3f2f2;width:160px;">
			<select lay-filter="storeageName" name="storeageId">
				<option value="">请选择仓库</option>	
				<option th:each="s:${stores}" th:value="${s.code}" th:text="${s.value}"></option>
			</select>
		</td>
		<td name="sup_code" style="background-color:#f3f2f2"></td>
		<td name="sup_name" style="background-color:#f3f2f2"></td>
		<td name="sup_spec" style="background-color:#f3f2f2"></td>
		<!-- 
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;text-align:center;">
			<span th:text="${saleOrderItem.settleMethodName}"></span>
		</td>
		<td style="background-color:#f3f2f2" name="settlementDay"><span th:text="${saleOrderItem.settleDays}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementCurrency"><span th:text="${saleOrderItem.settleCurrencyName}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementExchangeRate"><span th:text="${saleOrderItem.exchargeRate}"></span></td>
		<td style="background-color:#f3f2f2" name="origTaxRate"><span th:text="${saleOrderItem.origTaxRate}"></span>%</td>
		 -->
		<td style="padding-left:0px;padding-right:0px;width:120px;"><input style="width:120px;" type="text" name="amount" required  lay-verify="required|amountber" placeholder="订单数量" autocomplete="off" class="layui-input"></td>
		<td style="padding-left:0px;padding-right:0px;width:80px;"><input style="width:120px;" type="text" id="deliveryTime" name="deliveryTime" required  lay-verify="required|amountber" placeholder="交货日期" autocomplete="off" class="layui-input" ></td>
		<td style="padding-left:0px;padding-right:0px;width:80px;"><input style="width:120px;" type="text" name="price" required  lay-verify="required|amountber" placeholder="单价" autocomplete="off" class="layui-input"></td>
		<td name="origTaxPrice" style="background-color:#f3f2f2"><span></span></td>
		<td name='origDiscountAmount' style="background-color:#f3f2f2"><span></span></td>
		<td name="origTax" style="background-color:#f3f2f2"><span></span></td>
		<td name="origTaxAmount" style="background-color:#f3f2f2"><span></span></td>
		<td></td>
		<td></td>
		<td></td>
		<td name="balanceOfAccount"></td>
		<td name="balanceNonAccount"></td>
	</tr>
	</tbody>
</table>
<script th:inline="javascript">
	$(function(){ 
		/* var deliveryTimes =$.find("input[name='deliveryTime']");
		console.log(deliveryTimes); */
		layui.use("laydate",function(){
			var laydate = layui.laydate;
			laydate.render({
				  elem: '#deliveryTime' //指定元素
				});
		});
	});
</script>